check mobile number length in php

34

function validate_mobile($mobile)
{
    return preg_match('/^[6-9]\d{9}$/', $mobile);
}

if(validate_mobile(6428232817)){
    echo "Yes";
}else{
    echo "No";
}

Comments

Submit
0 Comments